<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:f="http://java.sun.com/jsf/core">

<f:view>
	<h:head>

		<script type="text/javascript"
			src="${facesContext.externalContext.requestContextPath}/views/scripts/jquery.js"></script>

		<style type="text/css" title="currentStyle">
			@import "${facesContext.externalContext.requestContextPath}/views/css/home1.css";
			@import "${facesContext.externalContext.requestContextPath}/views/css/app.css";
			@import "${facesContext.externalContext.requestContextPath}/views/css/reset.css";
			@import "${facesContext.externalContext.requestContextPath}/views/css/text.css";
			@import "${facesContext.externalContext.requestContextPath}/views/css/960.css";
			@import "${facesContext.externalContext.requestContextPath}/views/css/uni_form.css";
		</style>



		<script type="text/javascript">
			$(document).ready(function() {

			});
		</script>
	</h:head>
	<h:body id="players" class="team">
		<ui:include src="../header.xhtml" />
		<br />
		<br />
		<br />
		<h:form>
			<!--  -->
			<div id="main" class="container_12">
				<ui:include src="team_header.xhtml" />

				<div class="grid_12">
					<div class="grid_8 alpha">
						<div id="content" >
							<h1 id="h1">Edit Team Members</h1>
							<span id="smallbadge_container"></span>
							<div class="clear"></div>


							<div id="member-form-wrapper" class="uniForm">
								
								<h:inputText value="#{editMemberProfileBean.memberEmail}"></h:inputText>
								
								<fieldset class="blockLabels">
									<legend class="ctrlHolder">Edit #{editMemberProfileBean.firstName} #{editMemberProfileBean.lastName}</legend>
									
									<div class="ctrlHolder">
										<label for="member_first_name">First name</label>
										<br />
										<h:inputText class="textInput text" value="#{editMemberProfileBean.firstName}"></h:inputText>
									</div>

									<div class="ctrlHolder">
										<label for="member_last_name">Last name</label>
										<br />
										<h:inputText class="textInput text" value="#{editMemberProfileBean.lastName}"></h:inputText>
									</div>

									<div class="ctrlHolder">
										<label for="member_gender">Gender</label>
										<br />
										<h:selectOneMenu value="#{editMemberProfileBean.gender}">
											<f:selectItem itemValue="" itemLabel="" />
											<f:selectItem itemValue="Male" itemLabel="Male" />
											<f:selectItem itemValue="Female" itemLabel="Female" />
											<f:selectItem itemValue="Private" itemLabel="Private" />
										</h:selectOneMenu>
											
									</div>



									<div class="ctrlHolder">
										<em>To edit the phone number or email for this member:</em><br />
										<br /> 
										<h:commandLink class="btn" value="edit user profile" 
													   action="#{editMemberProfileBean.goToEditMemberProfileDetailsPageAction}">
											<f:setPropertyActionListener target="#{editMemberProfileDetailsBean.memberEmail}" value="#{editMemberProfileBean.memberEmail}"></f:setPropertyActionListener>
											<f:setPropertyActionListener target="#{editMemberProfileDetailsBean.firstName}" value="#{editMemberProfileBean.firstName}"></f:setPropertyActionListener>
											<f:setPropertyActionListener target="#{editMemberProfileDetailsBean.lastName}" value="#{editMemberProfileBean.lastName}"></f:setPropertyActionListener>
											<f:setPropertyActionListener target="#{editMemberProfileDetailsBean.phone}" value="#{memberService.getMember(editMemberProfileBean.memberEmail).phone}"></f:setPropertyActionListener>
											<f:setPropertyActionListener target="#{editMemberProfileDetailsBean.memberEmail}" value="#{editMemberProfileBean.memberEmail}"></f:setPropertyActionListener>
											<f:setPropertyActionListener target="#{editMemberProfileDetailsBean.gender}" value="#{memberService.getMember(editMemberProfileBean.memberEmail).gender}"></f:setPropertyActionListener>
											<f:setPropertyActionListener target="#{editMemberProfileDetailsBean.country}" value="#{memberService.getMember(editMemberProfileBean.memberEmail).country}"></f:setPropertyActionListener>
											<f:setPropertyActionListener target="#{editMemberProfileDetailsBean.state}" value="#{memberService.getMember(editMemberProfileBean.memberEmail).state}"></f:setPropertyActionListener>
											<f:setPropertyActionListener target="#{editMemberProfileDetailsBean.city}" value="#{memberService.getMember(editMemberProfileBean.memberEmail).city}"></f:setPropertyActionListener>
													   
										</h:commandLink>
									</div>


								</fieldset>
								<div class="buttonHolder">
									<input class="primaryAction submit" name="commit" type="submit"
										value="SAVE" /> or <a href="/teams/659053-/members">cancel</a>
								</div>
								
							</div>


							<div class="clear"></div>



						</div>
					</div>
				</div>
			</div>

		</h:form>
		<ui:include src="../footer.xhtml" />

	</h:body>
</f:view>
</html>